import trainingRequest from "@/utils/trainingRoom/trainingRequest";

interface delDataModel {
    name: string,
    params: {
        ids: string[]
    }
}

//获取历史页
const historyUrl = '/moment/viewRecords?access_token=c1620b5f-db33-4cd7-9ced-8b76c2278931&pageSize=10'
export const getHistoryPage = () => {
    return trainingRequest.get(historyUrl)
}

//删除历史
//https://www.dance365.com/apis/moment/viewRecords?access_token=c1620b5f-db33-4cd7-9ced-8b76c2278931&pageSize=10&pageNum=0
export const delHistoryList = (data: delDataModel) => {
    return trainingRequest.post('/task/tasks?access_token=fdb59b2e-5b46-4bfa-b688-741b805850d4', data)
}

//搜索历史
//https://www.dance365.com/apis/moment/viewRecords?access_token=c1620b5f-db33-4cd7-9ced-8b76c2278931&pageSize=10&pageNum=0&keyword=s
export const searchHistoryList = (data: string) => {
    return trainingRequest.get(`/moment/viewRecords?access_token=c1620b5f-db33-4cd7-9ced-8b76c2278931&pageSize=10&pageNum=0&keyword=${data}`)
}

//获取练习室页
//https://www.dance365.com/apis/trainingCenter/plans/search/findByUserId?access_token=c1620b5f-db33-4cd7-9ced-8b76c2278931&pageSize=20&pageNum=0&type=system
const trainingUrl = "/trainingCenter/plans/search/findByUserId?access_token=c1620b5f-db33-4cd7-9ced-8b76c2278931&pageSize=20&pageNum=0&type=system"
export const getTrainingPage = () => {
    return trainingRequest.get(trainingUrl)
}

//获取收藏页
//https://www.dance365.com/apis/moment/favoriteRecords/search/findByUserId?access_token=c1620b5f-db33-4cd7-9ced-8b76c2278931&pageSize=10&subject=activity
const collectionsUrl = "/moment/favoriteRecords/search/findByUserId?access_token=c1620b5f-db33-4cd7-9ced-8b76c2278931&pageSize=10&subject=activity"
export const getCollectionsPage = () => {
    return trainingRequest.get(collectionsUrl)
}

//我的创建
//https://www.dance365.com/apis/trainingCenter/plans/search/findByUserId?myListCategory=my_create&access_token=c1620b5f-db33-4cd7-9ced-8b76c2278931&pageSize=20&pageNum=0&type=system
const createUrl = '/trainingCenter/plans/search/findByUserId?myListCategory=my_create&access_token=c1620b5f-db33-4cd7-9ced-8b76c2278931&pageSize=20&pageNum=0&type=system'
export const getCreate = () => {
    return trainingRequest.get(createUrl)
}

//我的加入
//https://www.dance365.com/apis/trainingCenter/plans/search/findByUserId?myListCategory=my_join&access_token=c1620b5f-db33-4cd7-9ced-8b76c2278931&pageSize=20&pageNum=0&type=system
const joinUrl = '/trainingCenter/plans/search/findByUserId?myListCategory=my_join&access_token=c1620b5f-db33-4cd7-9ced-8b76c2278931&pageSize=20&pageNum=0&type=system'
export const getJoinPage = ()=>{
    return trainingRequest.get(joinUrl)
}
